package com.zj.leetcode.medium.dynamicProgramming;

/**
 * @program: algorithm
 * @description:
 * 只有两个键的键盘
 * 650 2-keys-keyboard
 * @author: Zhang Bo
 * @create: 2022-05-05 19:37:28
 **/
public class TwoKeysKeyboard{
    public static void main(String[] args) {
        Solution solution = new TwoKeysKeyboard().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public int minSteps(int n) {
            int res = 0;
            for (int i = 2; i <= n; i++) {
                while (n % i == 0) {
                    res += i;
                    n /= i;
                }
            }
            return res;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}
